{% extends 'polls/base.html' %}

{% load humanize %}

{% block content %}

{# apnumber 可以对1-9的数字转为英文单词 #}
{{ 1|apnumber }}-{{ 10|apnumber }}-{{ 9|apnumber }}-{{ 999|apnumber }}

<br />

{# intcomma #}
<pre>
{{ 4500|intcomma }}
{{ 4500.2|intcomma }}
{{ 45000|intcomma }}
{{ 450000|intcomma }}
{{ 4500000|intcomma }}
</pre>

<br />
{# intword 用于转化较大的数字为英语单词 #}
<pre>

{{ 0.03|intword }}
{{ 1000000|intword }}
{{ 1200000|intword }}
{{ 12000000000|intword }}
{{ 120000000000000|intword }}
</pre>

<br />
{# naturalday 可以把日期相对于当前日期转为 yesterday, today, tomorrow 其中之一 #}
<pre>
{{ date_now|naturalday }}
{{ date_yesterday|naturalday }}
{{ date_tomorrow|naturalday }}
{{ date_oldday|naturalday }}
</pre>

{# naturaltime #}

<br />
{# ordinal 转为名次的数字表示 #}
<pre>
{{ 1|ordinal }}
{{ 2|ordinal }}
{{ 3|ordinal }}
</pre>
{% endblock %}